<?php
include_once "top.php";
$userid = $_GET['userid'];
$shopid = $_GET['shopid'];
$totalscore = $_GET['totalscore'];
$totalnum = $_GET['totalnum'];
$selectedarray = $_GET['selectedarray'];
$postfee = $_GET['postfee'];

$user=$db->ig2_want('mae_user','id="'.trim($userid).'"');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" />
<meta content="telephone=no" name="format-detection" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<title>物流信息</title>
<link href="css/discount.css" rel="stylesheet" type="text/css" />
<link href="css/common.css" rel="stylesheet" type="text/css" />
<script src="inc/jquery.min.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
$(document).ready(function() {
	$("#commitbtn").click(function(){
		$.ajax({
			type: "GET",
			url: "ra_ajax_market.php",
			dataType: 'json',
			data: {
				method: "exchangeOwnerScore",
				userid: $("#userid").val(),
				shopid: $("#shopid").val(),
				postfee: $("#postfee").val(),
				totalscore: $("#totalscore").val(),
				totalnum:  $("#totalnum").val(),
				selectedarray: $("#selectedarray").val(),
				contactname: $("#contactname").val(),
				contactphone: $("#contactphone").val(),
				contactaddress: $("#contactaddress").val()
			},
			success: function(data){
				if (data.errcode == 1) {
					$("#cancel_con .exchangepop_body_txt2").html(data.errmsg);
					var windowWidth = $(window).outerWidth();
					var windowHeight = $(window).outerHeight();
					var popupHeight = $("#cancel_con").height();
					var popupWidth = $("#cancel_con").width();
					$(".pop_mask").width(windowWidth).height(windowHeight).fadeIn(500);
					$("#cancel_con").css({"position": "absolute"}).animate({left: windowWidth/2-popupWidth/2, top: windowHeight/2-popupHeight/2, opacity: "show" }, "slow");
				} else {
					var windowWidth = $(window).outerWidth();
					var windowHeight = $(window).outerHeight();
					var popupHeight = $("#commit_con").height();
					var popupWidth = $("#commit_con").width();
					$(".pop_mask").width(windowWidth).height(windowHeight).fadeIn(500);
					$("#commit_con").css({"position": "absolute"}).animate({left: windowWidth/2-popupWidth/2, top: windowHeight/2-popupHeight/2, opacity: "show" }, "slow");
				}
			}
		});
	});
});
</script>
<body>
<input type="hidden" id="userid" value="<?php echo($userid)?>" />
<input type="hidden" id="shopid" value="<?php echo($shopid)?>" />
<input type="hidden" id="postfee" value="<?php echo($postfee)?>" />
<input type="hidden" id="totalscore" value="<?php echo($totalscore)?>" />
<input type="hidden" id="totalnum" value="<?php echo($totalnum)?>" />
<input type="hidden" id="selectedarray" value='<?php echo($selectedarray)?>' />
<div id="discount_body" style="background: url(./images/shopowner_bg.png) no-repeat center;background-size:cover;background-position:bottom;position:absolute;">
<div class="discount_checkcon_outer">
<div class="discount_checkcon" style="background:url(./images/shopowner_bg2.png);padding-bottom:20px;">
<div class="discount_checkcon_title">物流信息</div>
<div class="discount_checkcon_input">
<div class="discount_checkcon_input_inner">
	<div class="discount_checkcon_input_inner_left">姓名</div>
	<div class="discount_checkcon_input_inner_right">
		<input id="contactname" name="contactname" value="<?php echo($user['name']);?>" type="text" placeholder="请输入姓名" style="color:#333;">
	</div>
</div>
<div class="discount_checkcon_input_inner">
	<div class="discount_checkcon_input_inner_left">电话</div>
	<div class="discount_checkcon_input_inner_right">
		<input id="contactphone" name="contactphone" value="<?php echo($user['phone']);?>" type="text" placeholder="请输入电话" style="color:#333;">
	</div>
</div>
<div class="discount_checkcon_input_inner">
	<div class="discount_checkcon_input_inner_left">地址</div>
	<div class="discount_checkcon_input_inner_right">
		<input id="contactaddress" name="contactaddress" value="<?php echo($user['address']);?>" type="text" placeholder="请输入地址" style="color:#333;">
	</div>
</div>

</div>
<div class="discount_checkcon_btn" style="margin-top:100px;"><a href="javascript:void(0);" id="commitbtn">确认</a></div>
</div>
</div>
    <div class="foot_txt" style="float:left;color:#7f7c7c;font-size:12px;width:100%;text-align:center;margin-bottom:10px;">本活动最终解释权归壳牌所有</div>
</div>

<div class='pop_mask'style="display:none;"></div>
<div class="exchangepop_body" style="display:none;" id="cancel_con">
    <div class="exchangepop_body_inner">
        <div class="exchangepop_body_cancel"><a href="javascript:void(0)" class="cancel"><img src="images/pop1_cancel.png" width="40" height="40" /></a></div>
        <div class="exchangepop_body_txt">
            <div class="exchangepop_body_txt1">提示</div>
            <div class="exchangepop_body_txt2"></div>
        </div>
        <div class="exchangepop_body_btn"><a href="javascript:void(0)" class="cancel">返回</a></div>
    </div>
</div>

<div class="exchangepop_body" style="display:none;" id="commit_con">
    <div class="exchangepop_body_inner">
        <div class="exchangepop_body_cancel"><a href="user.php"><img src="images/pop1_cancel.png" width="40" height="40" /></a></div>
        <div class="exchangepop_body_txt">
            <div class="exchangepop_body_txt1">提示</div>
            <div class="exchangepop_body_txt2">恭喜您成功兑换！实物礼品派送需耐心等候；球票兑换我们会于开赛前和您确认票务；如果兑换格瓦拉券、百胜券等电子商品，请参考说明使用，祝您体验愉快！</div>
        </div>
        <div class="exchangepop_body_btn"><a href="user.php">返回</a></div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function(){
        var height1 = window.screen.height;
        $(".discount_body").css({"min-height":(height1-40)});
        $(".discount_checkcon_outer").css({"min-height":(height1-60)});
        $(".discount_checkcon").css({"min-height":(height1-80)});

        $(".cancel").click(function(){
            $(".pop_mask").fadeOut(500);
            $("#cancel_con").fadeOut(500);
        });
    });
</script>
</html>
